﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StackExample
{
    class MyStack
    {
        private List<Object> stackList = new List<Object>();
        private Object msg = "Stack is empty";
        public void Push(Object entry)
        {
            stackList.Add(entry);
        }
        public void Clear()
        {
            stackList.Clear();
        }
        public Object Pop()
        {
            if (stackList.Count > 0)
            {
                Object a = stackList[stackList.Count - 1];
                stackList.RemoveAt(stackList.Count - 1);
                return a;
            }
            else return msg;
        }
    }
}
